using System;
using System.Collections ; 
using Parseq.Core ; 
using Parseq.Util ;

namespace Parseq.Compiler
{
	public class Parser
	{
		/* the grammar for the compiler will be quite similar to EBNF & ANTLR
		 * 
		 * ANY_CHAR : '.' 
		 * 
		 * ONE_MANY : '+'
		 * 
		 * ZERO_MANY : '*' 
		 * 
		 * ZERO_ONE : ?
		 * 
		 * OR : '|' 
		 * 
		 * GROUP_START : '(' 
		 * 
		 * GROUP_END : ')' 
		 * 
		 * LOWER : '\\l' => 'a'..'z'
		 * 
		 * UPPER : '\\u' => 'A'..'Z'
		 * 
		 * ALPHA : '\\a' => 'a'..'z' | 'A'..'Z'
		 * 
		 * DIGIT : '\\d' => '0'..'9'
		 * 
		 * ESCAPE : '\\'
		 * 
		 * INCLUSIVE_BETWEEN : '..'
		 * 
		 * ESCAPE_CHAR : ESCAPE CHAR => CHAR
		 * 
		 * SQ : '\'' 
		 * 
		 * NOT_SQ : ~'\''
		 * 
		 * LITERAL_STRING : SQ (ESCAPE_CHAR | NOT_SQ)* SQ
		 * 
		 * TOKEN_ID :'\A'('\A'|'\d'|'_')+ 
		 * 
		 * RULE_ID :'\a'('\a'|'\d'|'_')+ 
		 * 
		 * token_definition : TOKEN_ID ':' token_exp
		 * 
		 * token_exp : LITERAL_STRING | 
		 * 
		 */
        // the symbol table is used to build the parser (i.e. this object).
        // it should return a parser for the Tokens (which is used to produce the TokenReader)
        // it 
		private Hashtable tokenExps = new Hashtable(); // this is different type of parser... shall we build an expression 
		// tree first? that'll seem to make sense... let's see how we'll do that... 
		// the expression tree can return 
        // what we need to track is the symbol table - which by itself is basically good enough to almost produce the full parser for us! 
        // we probably don't just call it a symbol table then - we'll call it something else. 
        // but what the symbol table do is to handle from IExp onwards to handle the translation 
		private Hashtable ruleExps = new Hashtable(); 
        // the parser is what gets produced @ the end - this is where we are going to store certain options... 
        // for example - creating a reader 
		public Parser ()
		{
			// we are going to maintain a single parser object...??? and this parser 
		}
	}
}

